

#ifndef PARAMHANDLER_H_
#define PARAMHANDLER_H_

#include "../Common/TimeMs.h"

typedef enum {
	UNIFORM = 0,
	NORMAL = 1,
	EXPONENTIAL = 2
} DistributionType;


/**
 * This class handles parameters during evaluations
 */
class ParamHandler {
public:

	/**
	 * Empty constructor: initializes with the default parameters
	 */
	ParamHandler();

	/**
	 * Destructor
	 */
	virtual ~ParamHandler();

	/**
	 * Sets the default parameters
	 */
	void setDefaultParameters();
    float getIncremento() const
    {
        return incremento;
    }

    void setIncremento(float incremento)
    {
        this->incremento = incremento;
    }
    int getEachPerc() const
    {
        return eachPerc;
    }

    int getFirstPerc() const
    {
        return firstPerc;
    }

    int getLastPerc() const
    {
        return lastPerc;
    }
/*
    int getMaxAutSeqs() const
    {
        return maxAutSeqs;
    }
*/
    int getMaxWinSize() const
    {
        return maxWinSize;
    }

    int getMinWinSize() const
    {
        return minWinSize;
    }
/*
    int getNumConstraints() const
    {
        return numConstraints;
    }
*/
    int getNumRuleNegations() const
    {
        return numRuleNegations;
    }

    int getNumRuleParameters() const
    {
        return numRuleParameters;
    }

    int getNumRulePredicates() const
    {
        return numRulePredicates;
    }

    int getNumRules() const
    {
        return numRules;
    }

    bool isUseConsuming() const
    {
        return useConsuming;
    }

    void setEachPerc(int eachPerc)
    {
        this->eachPerc = eachPerc;
    }

    void setFirstPerc(int firstPerc)
    {
        this->firstPerc = firstPerc;
    }

    void setLastPerc(int lastPerc)
    {
        this->lastPerc = lastPerc;
    }
/*
    void setMaxAutSeqs(int maxAutSeqs)
    {
        this->maxAutSeqs = maxAutSeqs;
    }
*/
    void setMaxWinSize(int maxWinSize)
    {
        this->maxWinSize = maxWinSize;
    }

    void setMinWinSize(int minWinSize)
    {
        this->minWinSize = minWinSize;
    }
/*
    void setNumConstraints(int numConstraints)
    {
        this->numConstraints = numConstraints;
    }
*/
    void setNumRuleNegations(int numRuleNegations)
    {
        this->numRuleNegations = numRuleNegations;
    }

    void setNumRuleParameters(int numRuleParameters)
    {
        this->numRuleParameters = numRuleParameters;
    }

    void setNumRulePredicates(int numRulePredicates)
    {
        this->numRulePredicates = numRulePredicates;
    }

    void setNumRules(int numRules)
    {
        this->numRules = numRules;
    }

    void setUseConsuming(bool useConsuming)
    {
        this->useConsuming = useConsuming;
    }
    float getParLastProb() const
    {
        return parLastProb;
    }

    void setParLastProb(float parLastProb)
    {
        this->parLastProb = parLastProb;
    }

    float getParWindowDistribution() const
    {
        return parWindowDistribution;
    }

    void setParWindowDistribution(float parWindowDistribution)
    {
        this->parWindowDistribution = parWindowDistribution;
    }

	int getSeed() const
    {
        return seed;
    }

    void setSeed(int seed)
    {
        this->seed = seed;
    }

	DistributionType getEventInputDistribution() const
    {
        return eventInputDistribution;
    }

    DistributionType getSubsInputDistribution() const
    {
        return subsInputDistribution;
    }

    DistributionType getWindowSizeDistribution() const
    {
        return windowSizeDistribution;
    }

    void setEventInputDistribution(DistributionType eventInputDistribution)
    {
        this->eventInputDistribution = eventInputDistribution;
    }

    void setSubsInputDistribution(DistributionType subsInputDistribution)
    {
        this->subsInputDistribution = subsInputDistribution;
    }

    void setWindowSizeDistribution(DistributionType windowSizeDistribution)
    {
        this->windowSizeDistribution = windowSizeDistribution;
    }

	int getMaxIntValue() const
    {
        return maxIntValue;
    }

    int getMaxNumAttributes() const
    {
        return maxNumAttributes;
    }

    int getMaxWindowSize() const
    {
        return maxWindowSize;
    }

    int getMinIntValue() const
    {
        return minIntValue;
    }

    int getMinNumAttributes() const
    {
        return minNumAttributes;
    }

    int getNumEventTypes() const
    {
        return numEventTypes;
    }

    int getNumInterfaces() const
    {
        return numInterfaces;
    }

    int getNumNames() const
    {
        return numNames;
    }

    int getNumStringValues() const
    {
        return numStringValues;
    }

    int getPercIntEq() const
    {
        return percIntEq;
    }

    int getPercIntGt() const
    {
        return percIntGt;
    }

    int getPercIntLt() const
    {
        return percIntLt;
    }

    int getPubNum() const
    {
        return pubNum;
    }

    int getQueueSize() const
    {
        return queueSize;
    }

    int getSleepTime() const
    {
        return sleepTime;
    }

    int getSubNum() const
    {
        return subNum;
    }

    void setMaxIntValue(int maxIntValue)
    {
        this->maxIntValue = maxIntValue;
    }

    void setMaxNumAttributes(int maxNumAttributes)
    {
        this->maxNumAttributes = maxNumAttributes;
    }

    void setMaxWindowSize(int maxWindowSize)
    {
        this->maxWindowSize = maxWindowSize;
    }

    void setMinIntValue(int minIntValue)
    {
        this->minIntValue = minIntValue;
    }

    void setMinNumAttributes(int minNumAttributes)
    {
        this->minNumAttributes = minNumAttributes;
    }

    void setNumEventTypes(int numEventTypes)
    {
        this->numEventTypes = numEventTypes;
    }

    void setNumInterfaces(int numInterfaces)
    {
        this->numInterfaces = numInterfaces;
    }

    void setNumNames(int numNames)
    {
        this->numNames = numNames;
    }

    void setNumStringValues(int numStringValues)
    {
        this->numStringValues = numStringValues;
    }

    void setPercIntEq(int percIntEq)
    {
        this->percIntEq = percIntEq;
    }

    void setPercIntGt(int percIntGt)
    {
        this->percIntGt = percIntGt;
    }

    void setPercIntLt(int percIntLt)
    {
        this->percIntLt = percIntLt;
    }

    void setPubNum(int pubNum)
    {
        this->pubNum = pubNum;
    }

    void setQueueSize(int queueSize)
    {
        this->queueSize = queueSize;
    }

    void setSleepTime(int sleepTime)
    {
        this->sleepTime = sleepTime;
    }

    void setSubNum(int subNum)
    {
        this->subNum = subNum;
    }

private:
	/**
	 * Content properties
	 */
	int numEventTypes;
	int numNames;
	int numStringValues;

	int seed;
	/**
	 * Publication properties
	 */
	int maxNumAttributes;					// Must be lower than NUM_NAMES
	int minNumAttributes;
	int maxIntValue;
	int minIntValue;
	DistributionType eventInputDistribution;

	/**
	 * Subscription properties
	 */
	int numInterfaces;
	int maxWindowSize;
	int percIntEq;							// Percentage of eq operator in int constraints
	int percIntGt;							// Percentage of gt operator in int constraints
	int percIntLt;							// Percentage of lt operator in int constraints
	DistributionType subsInputDistribution;
	DistributionType windowSizeDistribution;
	float parWindowDistribution;
	float parLastProb;
	float incremento;

	/**
	 * Rules properties
	 */
	int numRules;
	int numRulePredicates;
	int numRuleParameters;
	int numRuleNegations;
//	int numConstraints; // Must be lower than NUM_NAMES
	int minWinSize;	// Milliseconds
	int maxWinSize;	// Milliseconds
//	int maxAutSeqs;
	int eachPerc;		// Percentage of each-within
	int firstPerc;	// Percentage of first-within
	int lastPerc; 	// Percentage of last-within
	bool useConsuming;


	/**
	 * System properties
	 */
	int queueSize;
	int pubNum;
	int subNum;
	int sleepTime; // Microseconds

};

#endif
